#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<cmath>
using namespace std;
int n;
map<int, int> prime;
int main()
{
	scanf("%d", &n);
	vector<int> v;
	vector<int> cnt;
	int m = n;
	for (int i = 2; i <= n / i; i++)
	{
		if (n % i == 0)
		{
			int count = 0;
			while (n % i == 0)
			{
				n /= i;
				count++;
			}
			v.push_back(i);
			cnt.push_back(count);
		}
		
	}
	if (n > 1)
	{
		v.push_back(n);
		cnt.push_back(1);
	}
	int h = sqrt(m);
	int ans = 1;
	while (ans < h)
	{
		for(int i=0;i<v.size();i++)
		{
			if (cnt[i])
			{
				ans *= v[i];
				cnt[i]--;
			}
			if (ans >= h) break;
		}
	}
	int b = m / ans;
	printf("%d\n", ans + b);
	for (int i = 1; i <= ans; i++) printf("0");
	for (int i = 1; i <= b; i++) printf("1");
	return 0;
}